#pragma once

/* U3D_U2PHYACR4 */
#define RG_USB20_DP_100K_MODE_OFST         (18)
#define RG_USB20_DM_100K_EN_OFST           (17)
#define USB20_DP_100K_EN_OFST              (16)
#define USB20_GPIO_DM_I_OFST               (15)
#define USB20_GPIO_DP_I_OFST               (14)
#define USB20_GPIO_DM_OE_OFST              (13)
#define USB20_GPIO_DP_OE_OFST              (12)
#define RG_USB20_GPIO_CTL_OFST             (9)
#define USB20_GPIO_MODE_OFST               (8)
#define RG_USB20_TX_BIAS_EN_OFST           (5)
#define RG_USB20_TX_VCMPDN_EN_OFST         (4)
#define RG_USB20_HS_SQ_EN_MODE_OFST        (2)
#define RG_USB20_HS_RCV_EN_MODE_OFST       (0)

/* U3D_U2PHYACR4 */
#define RG_USB20_DP_100K_MODE              (0x1<<18)	/* 18:18 */
#define RG_USB20_DM_100K_EN                (0x1<<17)	/* 17:17 */
#define USB20_DP_100K_EN                   (0x1<<16)	/* 16:16 */
#define USB20_GPIO_DM_I                    (0x1<<15)	/* 15:15 */
#define USB20_GPIO_DP_I                    (0x1<<14)	/* 14:14 */
#define USB20_GPIO_DM_OE                   (0x1<<13)	/* 13:13 */
#define USB20_GPIO_DP_OE                   (0x1<<12)	/* 12:12 */
#define RG_USB20_GPIO_CTL                  (0x1<<9)	/* 9:9 */
#define USB20_GPIO_MODE                    (0x1<<8)	/* 8:8 */
#define RG_USB20_TX_BIAS_EN                (0x1<<5)	/* 5:5 */
#define RG_USB20_TX_VCMPDN_EN              (0x1<<4)	/* 4:4 */
#define RG_USB20_HS_SQ_EN_MODE             (0x3<<2)	/* 3:2 */
#define RG_USB20_HS_RCV_EN_MODE            (0x3<<0)	/* 1:0 */

/* U3D_USBPHYACR6 */
#define RG_USB20_ISO_EN_OFST               (31)
#define RG_USB20_PHY_REV_OFST              (24)
#define RG_USB20_BC11_SW_EN_OFST           (23)
#define RG_USB20_SR_CLK_SEL_OFST           (22)
#define RG_USB20_OTG_VBUSCMP_EN_OFST       (20)
#define RG_USB20_OTG_ABIST_EN_OFST         (19)
#define RG_USB20_OTG_ABIST_SELE_OFST       (16)
#define RG_USB20_HSRX_MMODE_SELE_OFST      (12)
#define RG_USB20_HSRX_BIAS_EN_SEL_OFST     (9)
#define RG_USB20_HSRX_TMODE_EN_OFST        (8)
#define RG_USB20_DISCTH_OFST               (4)
#define RG_USB20_SQTH_OFST                 (0)

/* U3D_USBPHYACR6 */
#define RG_USB20_ISO_EN                    (0x1U<<31)	/* 31:31 */
#define RG_USB20_PHY_REV                   (0xef<<24)	/* 31:24 */
#define RG_USB20_BC11_SW_EN                (0x1<<23)	/* 23:23 */
#define RG_USB20_SR_CLK_SEL                (0x1<<22)	/* 22:22 */
#define RG_USB20_OTG_VBUSCMP_EN            (0x1<<20)	/* 20:20 */
#define RG_USB20_OTG_ABIST_EN              (0x1<<19)	/* 19:19 */
#define RG_USB20_OTG_ABIST_SELE            (0x7<<16)	/* 18:16 */
#define RG_USB20_HSRX_MMODE_SELE           (0x3<<12)	/* 13:12 */
#define RG_USB20_HSRX_BIAS_EN_SEL          (0x3<<9)	/* 10:9 */
#define RG_USB20_HSRX_TMODE_EN             (0x1<<8)	/* 8:8 */
#define RG_USB20_DISCTH                    (0xf<<4)	/* 7:4 */
#define RG_USB20_SQTH                      (0xf<<0)	/* 3:0 */

/* U3D_U2PHYDTM0 */
#define RG_UART_MODE_OFST                  (30)
#define FORCE_UART_I_OFST                  (29)
#define FORCE_UART_BIAS_EN_OFST            (28)
#define FORCE_UART_TX_OE_OFST              (27)
#define FORCE_UART_EN_OFST                 (26)
#define FORCE_USB_CLKEN_OFST               (25)
#define FORCE_DRVVBUS_OFST                 (24)
#define FORCE_DATAIN_OFST                  (23)
#define FORCE_TXVALID_OFST                 (22)
#define FORCE_DM_PULLDOWN_OFST             (21)
#define FORCE_DP_PULLDOWN_OFST             (20)
#define FORCE_XCVRSEL_OFST                 (19)
#define FORCE_SUSPENDM_OFST                (18)
#define FORCE_TERMSEL_OFST                 (17)
#define FORCE_OPMODE_OFST                  (16)
#define UTMI_MUXSEL_OFST                   (15)
#define RG_RESET_OFST                      (14)
#define RG_DATAIN_OFST                     (10)
#define RG_TXVALIDH_OFST                   (9)
#define RG_TXVALID_OFST                    (8)
#define RG_DMPULLDOWN_OFST                 (7)
#define RG_DPPULLDOWN_OFST                 (6)
#define RG_XCVRSEL_OFST                    (4)
#define RG_SUSPENDM_OFST                   (3)
#define RG_TERMSEL_OFST                    (2)
#define RG_OPMODE_OFST                     (0)

/* U3D_U2PHYDTM0 */
#define RG_UART_MODE                       (0x3<<30)	/* 31:30 */
#define FORCE_UART_I                       (0x1<<29)	/* 29:29 */
#define FORCE_UART_BIAS_EN                 (0x1<<28)	/* 28:28 */
#define FORCE_UART_TX_OE                   (0x1<<27)	/* 27:27 */
#define FORCE_UART_EN                      (0x1<<26)	/* 26:26 */
#define FORCE_USB_CLKEN                    (0x1<<25)	/* 25:25 */
#define FORCE_DRVVBUS                      (0x1<<24)	/* 24:24 */
#define FORCE_DATAIN                       (0x1<<23)	/* 23:23 */
#define FORCE_TXVALID                      (0x1<<22)	/* 22:22 */
#define FORCE_DM_PULLDOWN                  (0x1<<21)	/* 21:21 */
#define FORCE_DP_PULLDOWN                  (0x1<<20)	/* 20:20 */
#define FORCE_XCVRSEL                      (0x1<<19)	/* 19:19 */
#define FORCE_SUSPENDM                     (0x1<<18)	/* 18:18 */
#define FORCE_TERMSEL                      (0x1<<17)	/* 17:17 */
#define FORCE_OPMODE                       (0x1<<16)	/* 16:16 */
#define UTMI_MUXSEL                        (0x1<<15)	/* 15:15 */
#define RG_RESET                           (0x1<<14)	/* 14:14 */
#define RG_DATAIN                          (0xf<<10)	/* 13:10 */
#define RG_TXVALIDH                        (0x1<<9)	/* 9:9 */
#define RG_TXVALID                         (0x1<<8)	/* 8:8 */
#define RG_DMPULLDOWN                      (0x1<<7)	/* 7:7 */
#define RG_DPPULLDOWN                      (0x1<<6)	/* 6:6 */
#define RG_XCVRSEL                         (0x3<<4)	/* 5:4 */
#define RG_SUSPENDM                        (0x1<<3)	/* 3:3 */
#define RG_TERMSEL                         (0x1<<2)	/* 2:2 */
#define RG_OPMODE                          (0x3<<0)	/* 1:0 */

/* U3D_U2PHYDTM1 */
#define RG_USB20_PRBS7_EN_OFST             (31)
#define RG_USB20_PRBS7_BITCNT_OFST         (24)
#define RG_USB20_CLK48M_EN_OFST            (23)
#define RG_USB20_CLK60M_EN_OFST            (22)
#define RG_UART_I_OFST                     (19)
#define RG_UART_BIAS_EN_OFST               (18)
#define RG_UART_TX_OE_OFST                 (17)
#define RG_UART_EN_OFST                    (16)
#define RG_IP_U2_PORT_POWER_OFST           (15)
#define FORCE_IP_U2_PORT_POWER_OFST        (14)
#define FORCE_VBUSVALID_OFST               (13)
#define FORCE_SESSEND_OFST                 (12)
#define FORCE_BVALID_OFST                  (11)
#define FORCE_AVALID_OFST                  (10)
#define FORCE_IDDIG_OFST                   (9)
#define FORCE_IDPULLUP_OFST                (8)
#define RG_VBUSVALID_OFST                  (5)
#define RG_SESSEND_OFST                    (4)
#define RG_BVALID_OFST                     (3)
#define RG_AVALID_OFST                     (2)
#define RG_IDDIG_OFST                      (1)
#define RG_IDPULLUP_OFST                   (0)

/* U3D_U2PHYDTM1 */
#define RG_USB20_PRBS7_EN                  (0x1<<31)	/* 31:31 */
#define RG_USB20_PRBS7_BITCNT              (0x3f<<24)	/* 29:24 */
#define RG_USB20_CLK48M_EN                 (0x1<<23)	/* 23:23 */
#define RG_USB20_CLK60M_EN                 (0x1<<22)	/* 22:22 */
#define RG_UART_I                          (0x1<<19)	/* 19:19 */
#define RG_UART_BIAS_EN                    (0x1<<18)	/* 18:18 */
#define RG_UART_TX_OE                      (0x1<<17)	/* 17:17 */
#define RG_UART_EN                         (0x1<<16)	/* 16:16 */
#define RG_IP_U2_PORT_POWER                (0x1<<15)	/* 15:15 */
#define FORCE_IP_U2_PORT_POWER             (0x1<<14)	/* 14:14 */
#define FORCE_VBUSVALID                    (0x1<<13)	/* 13:13 */
#define FORCE_SESSEND                      (0x1<<12)	/* 12:12 */
#define FORCE_BVALID                       (0x1<<11)	/* 11:11 */
#define FORCE_AVALID                       (0x1<<10)	/* 10:10 */
#define FORCE_IDDIG                        (0x1<<9)	/* 9:9 */
#define FORCE_IDPULLUP                     (0x1<<8)	/* 8:8 */
#define RG_VBUSVALID                       (0x1<<5)	/* 5:5 */
#define RG_SESSEND                         (0x1<<4)	/* 4:4 */
#define RG_BVALID                          (0x1<<3)	/* 3:3 */
#define RG_AVALID                          (0x1<<2)	/* 2:2 */
#define RG_IDDIG                           (0x1<<1)	/* 1:1 */
#define RG_IDPULLUP                        (0x1<<0)	/* 0:0 */